# 语音转文本 https://github.com/PaddlePaddle/PaddleSpeech/tree/develop/demos/speech_recognition
# https://github.com/PaddlePaddle/PaddleSpeech/blob/develop/docs/source/asr/models_introduction.md
# java 实现长语音音频分割 https://github.com/mymagicpower/AIAS/tree/main/3_audio_sdks/asr_long_audio_sdk
import paddle
from paddlespeech.cli import ASRExecutor

asr_executor = ASRExecutor()
text = asr_executor(
    model='conformer_wenetspeech',
    lang='zh',
    sample_rate=16000,
    config=None,  # Set `config` and `ckpt_path` to None to use pretrained model.
    ckpt_path=None,
    audio_file='./hunhe.wav',
    force_yes=False,
    device=paddle.get_device())
print('ASR Result: \n{}'.format(text))